package com.huike.clues.mapper;

import java.util.List;

import com.huike.common.annotation.AutoFill;
import com.huike.common.core.domain.TreeSelect;
import com.huike.common.core.domain.entity.SysDept;
import com.huike.common.enums.DaoOperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author EthanRuins
 * @apiNote 部门表(SysDept)表数据库访问层
 * @since 2023-07-11 15:17:47
 */
@Mapper
public interface SysDeptMapper {
    @AutoFill(DaoOperationType.INSERT)
    int save(SysDept sysDept);

    @AutoFill(DaoOperationType.UPDATE)
    int update(SysDept sysDept);

    int deleteById(Long deptId);

    SysDept getByName(String deptName);

    SysDept getById(Long deptId);

    List<SysDept> getByParentId(Long parentId);

    List<SysDept> getDeptList(SysDept dept);

    List<TreeSelect> getDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);

    /**
     * 根据部门ID查询信息
     *
     * @param deptId 部门ID
     * @return 部门信息
     */
    SysDept selectDeptById(Long deptId);
}

